﻿<Window x:Class="P2.Cuberry.Modules.RealEstate.REPlot.REPlotsDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    xmlns:basec="clr-namespace:P2.Cuberry.Framework.Helper;assembly=P2.Cuberry.Framework.Helper"    
    
        
        Icon="/P2.Cuberry;component/Images/CuberryIcon32.ico"
        Title="Peacequare Cuberry" Width="920" Height="480"  
        Background="{DynamicResource P2BackgroundBrush}" 
        Closing="Window_Closing"
        >

    <Window.Resources>

        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/Styles.xaml"/>
                <ResourceDictionary Source="/P2.Cuberry.Framework.Layout;component/Styles/CuberryDataGrid.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Grid.Resources>
            <Image x:Key="SaveIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.RealEstate.REPlot;component/Images/save.png" />
            <Image x:Key="CancelIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.RealEstate.REPlot;component/Images/cancel.png" />
            <Image x:Key="ClosingIcon" Height="16" Width="16" Source="/P2.Cuberry.Modules.RealEstate.REPlot;component/Images/save.png" />
            <Image x:Key="Printer2Icon" Height="16" Width="16" Source="/P2.Cuberry.Modules.RealEstate.REPlot;component/Images/printer2.png" />
        </Grid.Resources>


        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="40" />
            <RowDefinition Height="35" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="35" />
        </Grid.RowDefinitions>

        <!-- Row 0 Start -->
        <Label Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Content="{Translate DialogHeaderREPlotDetail}" Style="{StaticResource P2DetailViewHeaderTextStyle}" />
        
        <Separator Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Bottom" Height="0"/>
        <!-- Row 0 End -->

        <!-- Row 1: Menu Start -->
        <Border  Grid.Row="1" Grid.Column="0"  Style="{StaticResource P2MenuBorderStyle}">
            <Grid>
            <Menu Grid.Row="1" x:Name="menuMain" Style="{StaticResource P2MenuStyle}" >
                <MenuItem x:Name="SaveBtn" Margin="2,1,0,2"  InputGestureText="Ctrl+S" Header="{Translate SaveBtn}" Command="{Binding REPlotSaveCommand}"  Icon="{StaticResource SaveIcon}" Style="{StaticResource P2MenuItemStyle}" />
                <MenuItem x:Name="CloseBtn" Margin="2,1,0,2" InputGestureText="Ctrl+X" Header="{Translate SaveAndCloseBtn}" Command="{Binding REPlotCloseCommand}" Icon="{StaticResource CancelIcon}" Style="{StaticResource P2MenuItemStyle}"/>
                                
                <MenuItem x:Name="PrintBtn" Margin="2,1,0,2" Header="{Translate PrintBtn}" Click="PrintBtn_Click" Icon="{StaticResource Printer2Icon}" Style="{StaticResource P2MenuItemStyle}"/>
                </Menu>
                
                <Menu Grid.Row="1" HorizontalAlignment="Right" x:Name="menuMainRight" Style="{StaticResource P2MenuStyle}" >
                    <MenuItem x:Name="HistoryBtn" Command="{Binding HistoryCommand}"  Style="{StaticResource P2MenuItemStyleHistory}"/>
                    <MenuItem x:Name="InfoBtn" Command="{Binding InfoCommand}"  Style="{StaticResource P2MenuItemStyleInfo}"/>
                </Menu>
            </Grid>
        </Border>


        <!-- Row 1 End -->

        <!-- Row 2: All Fields -->
        <Border  Grid.Row="2" Grid.Column="0"  Style="{StaticResource P2ContentBorderStyle}">
            <Grid Grid.Row="2" Grid.Column="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="604*"/>
                    <ColumnDefinition Width="0*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Label Margin="22,14,0,0" Name="PlotNoL" Height="28" VerticalAlignment="Top" Content="{Translate PlotNoL}" HorizontalAlignment="Left" Width="247"></Label>
                <TextBox Margin="22,35,0,0" Name="PlotNo" Height="23" Text="{Binding Model.PlotNo, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Style="{StaticResource P2TextBoxStyle}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="247" />

                <Label Content="{Translate PlotPriceL}" Height="28" HorizontalAlignment="Left" Margin="22,56,0,0" Name="PlotPriceL" VerticalAlignment="Top" Width="247" />
                <TextBox Margin="22,77,0,0" Name="PlotPrice" Height="23" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.PlotPrice, StringFormat=N2, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="247" HorizontalContentAlignment="Right" FlowDirection="LeftToRight"/>                
                                
                <Label Content="{Translate PlotCircumferenceL}" Height="28" HorizontalAlignment="Left" Margin="22,98,0,0" Name="PlotCircumferenceL" VerticalAlignment="Top" Width="247" />
                <TextBox Margin="22,119,0,0" Name="PlotCircumference" Height="23" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.PlotCircumference, StringFormat=N2, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" HorizontalAlignment="Left" Width="247"  HorizontalContentAlignment="Right" FlowDirection="LeftToRight"/>

                <Label Content="{Translate PlotAreaL}" Height="28" HorizontalAlignment="Left" Margin="22,140,0,0" Name="PlotAreaL" VerticalAlignment="Top" Width="247" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="22,161,0,0" Name="PlotArea" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.PlotArea, StringFormat=N2, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" Width="247"  HorizontalContentAlignment="Right" FlowDirection="LeftToRight"/>

                <Label Content="{Translate PlotLengthL}" Height="28" HorizontalAlignment="Left" Margin="22,182,0,0" Name="PlotLengthL" VerticalAlignment="Top" Width="247" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="22,203,0,0" Name="PlotLength" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.PlotLength, StringFormat=N2, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" Width="247"  HorizontalContentAlignment="Right" FlowDirection="LeftToRight"/>

                <Label Content="{Translate PlotWidthL}" Height="28" HorizontalAlignment="Left" Margin="22,224,0,0" Name="PlotWidthL" VerticalAlignment="Top" Width="247" />
                <TextBox Height="23" HorizontalAlignment="Left" Margin="22,245,0,0" Name="PlotWidth" Style="{StaticResource P2TextBoxStyle}" Text="{Binding Model.PlotWidth, StringFormat=N2, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" VerticalAlignment="Top" Width="247"  HorizontalContentAlignment="Right" FlowDirection="LeftToRight"/>

                <Label Margin="22,266,0,0" Content="{Translate PlotCategoryIDL}"  Name="PlotCategoryIDL" Height="28" VerticalAlignment="Top" HorizontalAlignment="Left" Width="247" />
                <ComboBox Margin="22,287,0,0" DisplayMemberPath="PlotCategoryNameCur" Name="PlotCategoryID" SelectedValuePath="PlotCategoryID" SelectedValue="{Binding PlotCategoryID, ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"   
                                      ItemsSource="{Binding PlotCategorys}"
                                      IsEnabled="{Binding IsEditable}"
                                      Style="{StaticResource P2ComboBoxStyle}" Validation.ErrorTemplate="{StaticResource ErrorTemplate}" Height="24" VerticalAlignment="Top" HorizontalAlignment="Left" Width="247" />


                <TabControl Margin="341,3,3,3" Name="tabControl1" MinWidth="540" MinHeight="317" BorderBrush="{DynamicResource P2BackgroundBrush}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                   
                    <TabItem Header="{Translate ServicesL}" Name="tabItemServices" Background="White">
                        <Grid  Background="White">

                            <Border Margin="5,0,5,5"   VerticalAlignment="Stretch" BorderThickness="1" CornerRadius="2,2,2,2" BorderBrush="#FF6893CF">
                                <Grid ShowGridLines="False">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="20"/>
                                        <RowDefinition Height="*"/>
                                        <RowDefinition Height="34"/>
                                    </Grid.RowDefinitions>
                                   
                                    <DataGrid Grid.Row="1" Margin="3,0,3,0" 
                                                 Name="REPlotServiceItemList"                                                  
                                                 ItemsSource="{Binding Contacts}"
                                                 MouseDoubleClick="REPlotServiceItem_MouseDoubleClick"
                                                 Style="{DynamicResource CuberryDataGridStyle}"
                                                 VerticalAlignment="Top" >
                                        
                                        <DataGrid.Columns>
                                            <DataGridTextColumn   Header="{Translate ServiceNameL}" IsReadOnly="True"  Binding="{Binding ServiceNameCur}" 
                                                              Width="*" MinWidth="40" />
                                            <DataGridTextColumn   Header="{Translate ServicePriceL}" IsReadOnly="True"  Binding="{Binding Path=ServicePrice, StringFormat=N2}"  
                                                              Width="200" MinWidth="40" CellStyle="{StaticResource AlwaysRightAlignedCellStyle}"/>
                                            
                                        </DataGrid.Columns>
                                    </DataGrid>
                                    
                                    
                                </Grid>
                            </Border>


                        </Grid  >
                    </TabItem>

                    <TabItem Header="{Translate NoteL}" Name="tabItemNote" Background="White" >
                        <Grid  Background="White">
                            <Label Margin="10,10,0,0" HorizontalAlignment="Left" Name="NoteL" Content="{Translate NoteL}" Width="120" Height="22.723" VerticalAlignment="Top" />
                            <TextBox Margin="10,31,5,0" Name="Note" VerticalScrollBarVisibility="Auto" Style="{StaticResource P2TextBoxStyle}"
                         Text="{Binding Model.Note , ValidatesOnExceptions=True, NotifyOnValidationError=True, ValidatesOnDataErrors=True}"
                         IsReadOnly="{Binding IsReadOnly}" Height="110" VerticalAlignment="Top" />
                        </Grid  >
                    </TabItem>
                </TabControl>
                
            </Grid>
        </Border>

        <!-- Row 2: End -->


        <!-- Row 3: Bottom: Status Bar Start -->
        <Border Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripBorderStyle}" >
            <Grid Grid.Row="3" Grid.Column="0" Style="{StaticResource P2StatusStripGridStyle}">
                <basec:P2StatusStrip x:Name="StatusStrip" MessageStack2="{Binding MessageStack}"  Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Left" ContentStringFormat=""></basec:P2StatusStrip>
                <TextBox Name="Status" Grid.Column="0" Grid.Row="3" Height="Auto" Width="Auto" Background="White" HorizontalAlignment="Right" Text="{Binding Model.StatusName, Mode=OneWay}" IsReadOnly="True" BorderBrush="Transparent" />
            </Grid>
        </Border>

        <!-- Row 3: End -->
    </Grid>
</Window>
